// TODO: java版临时注释 默认值优先级低
// package com.inspur.edp.bef.dtgenerator.core.beActionAssembler.defaultValue;
//
//
// import com.inspur.edp.bef.dtgenerator.core.BefCoreGenCtx;
// import com.inspur.edp.caf.generator.baseInfo.ParameterInfo;
// import com.inspur.edp.caf.generator.method.ClassMethodGenerator;
// import com.inspur.edp.cef.entity.entity.IEntityData;
// import com.inspur.edp.das.commonmodel.IGspCommonObject;
// import com.sun.deploy.util.ReflectionUtil;
// import org.eclipse.jdt.core.dom.Modifier.ModifierKeyword;
//
// public class NodeSetFieldValueMethodGenerator extends ClassMethodGenerator
// {
//	private static final String entityDataParName = "entitydata";
//	private static final String propNameParName = "propName";
//	private static final String valueParName = "value";
//	ParameterInfo tempVar = new ParameterInfo();
//	ParameterInfo tempVar2 = new ParameterInfo();
//	ParameterInfo tempVar3 = new ParameterInfo();
//
//		//region Basic
//	private BefCoreGenCtx coreGenCtx;
//	private IGspCommonObject node;
//
//	public NodeSetFieldValueMethodGenerator(BefCoreGenCtx coreGenCtx, IGspCommonObject node)
//	{
//		this.coreGenCtx = coreGenCtx;
//		this.node = node;
//	}
//	tempVar.setParamName(entityDataParName);
//	tempVar.setParamType(com.inspur.edp.cef.generator.overall.Utils.createTypeInfo(IEntityData
// .class));
//
//
//		//region Static Members
//
//	public static String  getItemName(IGspCommonObject node) { return "SetFieldValue"; }
//	tempVar2.setParamName(propNameParName);
//	tempVar2.setParamType(com.inspur.edp.cef.generator.overall.Utils.createTypeInfo(String.class));
//
//
//	@Override
//	protected java.util.ArrayList<ModifierKeyword>  getAccessModifiers() { return new
// java.util.ArrayList<ModifierKeyword>(java.util.Arrays.asList(new ModifierKeyword[] {
// ModifierKeyword.PUBLIC_KEYWORD })); }
//	tempVar3.setParamName(valueParName);
//	tempVar3.setParamType(com.inspur.edp.cef.generator.overall.Utils.createTypeInfo(Object.class));
//
//
//	@Override
//	protected String  getMethodName() { return GetItemName(node); }
//
//
//	@Override
//	protected java.util.ArrayList<ParameterInfo>  getParameterCollection() { return new
// java.util.ArrayList<ParameterInfo>(java.util.Arrays.asList(new ParameterInfo[] { tempVar,
// tempVar2, tempVar3 })); }
//
//		//endregion
//
//
//	@Override
//	protected TypeInfo  getReturnType() { return void.class; }
//
//		//endregion
//
//
//		//region MethodBody
////
////        public void  setValue_NodeCode()
////        {
////            switch (propName)
////            {
////                case "Code":
////                    ((ISalesOrder)entitydata).getCode() = (string)value;
////                    break;
////                default:
////                    throw new ArgumentOutOfRangeException("propName", propName, "invalid
// propName");
////            }
////        }
////
//	@Override
//	protected Block  buildMethodBody()
//	{
//		java.util.ArrayList<SwitchSectionSyntax> switchSections = new
// java.util.ArrayList<SwitchSectionSyntax>();
//		//todo:wj-已改为工程生成的ApiAssembly
//
//		var entityAssembly = coreGenCtx.getBeGenCtx().ProjectApiAssembly;
//		var nodeType = entityAssembly.GetType(node.GetGeneratedEntityClassInfo().GetClassFullName());
//		//var entityAssembly = coreGenCtx.getBeGenCtx().EntityAssembly;
//		//var nodeType =
// entityAssembly.GetType(coreGenCtx.getBeGenCtx().DataInterfaceTypes[node.getCode()].FullName);
//		DataValidator.CheckForNullReference(nodeType, "nodeType");
//		for (var element : node.getAllElementList(false))
//		{
//			//关联字段暂不支持默认值, 主键不支持默认值
//			if (element.HasAssociation || node.IDElement == element)
//			{
//				continue;
//			}
//
//	switchSections.add(SyntaxFactory.SwitchSection().WithLabels(SyntaxFactory.<SwitchLabelSyntax>SingletonList(SyntaxFactory.CaseSwitchLabel(SyntaxFactory.LiteralExpression(SyntaxKind.StringLiteralExpression, SyntaxFactory.Literal(element.LabelID))))).WithStatements(SyntaxFactory.<StatementSyntax>List(new StatementSyntax[]{ SyntaxFactory.ExpressionStatement(SyntaxFactory.AssignmentExpression(SyntaxKind.SimpleAssignmentExpression, SyntaxFactory.MemberAccessExpression(SyntaxKind.SimpleMemberAccessExpression, SyntaxFactory.ParenthesizedExpression(SyntaxFactory.CastExpression(TypeUtils.GetTypeSyntax(nodeType), SyntaxFactory.IdentifierName(entityDataParName))), SyntaxFactory.IdentifierName(element.LabelID)), SyntaxFactory.CastExpression(TypeUtils.GetTypeSyntax(Utils.ConvertPropNativeType(Utils.GetPropertyType(nodeType, element.LabelID))), SyntaxFactory.IdentifierName(valueParName)))), SyntaxFactory.BreakStatement()})));
//		}
//
//	switchSections.add(SyntaxFactory.SwitchSection().WithLabels(SyntaxFactory.<SwitchLabelSyntax>SingletonList(SyntaxFactory.DefaultSwitchLabel())).WithStatements(SyntaxFactory.<StatementSyntax>SingletonList(SyntaxFactory.ThrowStatement(SyntaxFactory.ObjectCreationExpression(TypeUtils.GetTypeSyntax(ArgumentOutOfRangeException.class)).WithArgumentList(SyntaxFactory.ArgumentList(SyntaxFactory.<ArgumentSyntax>SeparatedList(new SyntaxNodeOrToken[]{ SyntaxFactory.Argument(SyntaxFactory.LiteralExpression(SyntaxKind.StringLiteralExpression, SyntaxFactory.Literal(propNameParName))), SyntaxFactory.Token(SyntaxKind.CommaToken), SyntaxFactory.Argument(SyntaxFactory.IdentifierName(propNameParName)), SyntaxFactory.Token(SyntaxKind.CommaToken), SyntaxFactory.Argument(SyntaxFactory.LiteralExpression(SyntaxKind.StringLiteralExpression, SyntaxFactory.Literal("invalid " + propNameParName)))})))))));
//
//		return
// SyntaxFactory.Block(SyntaxFactory.<StatementSyntax>SingletonList(SyntaxFactory.SwitchStatement(SyntaxFactory.IdentifierName(propNameParName)).WithSections(SyntaxFactory.<SwitchSectionSyntax>List(switchSections.toArray(new SwitchSectionSyntax[]{})))));
//	}
//
//	public final java.lang.Class  getUdtNativeType(IGSPCommonElement element)
//	{
//		var udtMetadata =
// coreGenCtx.getBeGenCtx().getMetadataPool().getGetMetadataContent()<SimpleDataTypeDef>(element.UdtPkgName, element.UdtID);
//		var udtType = ReflectionUtil
//				.GetTypeFromAssembly(udtMetadata.AssemblyName, String.Concat(udtMetadata.AssemblyName, ".",
// udtMetadata.GetUdtEntityClassName()));
//		return udtType.getSuperclass().GenericTypeArguments[0];
//	}
//
//		//endregion
// }
